﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Keywords" content="cssfile">
<meta name="Description" content="">
<meta name="format-detection" content="telephone=no" />
<meta property="wb:webmaster" content="ed0a75e93ed55263" />
<meta name="renderer" content="webkit">
<title> 好乐买 正品鞋</title>
<link rel="shortcut icon" href="http://0.js.lx.okbuycdn.com/resources/images/favicon.ico">
	<link rel="stylesheet" type="text/css" href="{{asset('/HomeCss/css/login.css')}}">
<script type="text/javascript" src="{{asset('/HomeCss/js/jquery-1.9.0.js')}}"></script>
<script type="text/javascript" src="{{asset('/HomeCss/js/jquery-toggle-password.js')}}"></script>
<script type="text/javascript" src="{{asset('/HomeCss/js/miniheader.js')}}"></script>
<script type="text/javascript" src="{{asset('/HomeCss/js/inputstyle.js')}}"></script>
<script type="text/javascript" src="{{asset('/HomeCss/js/register.js')}}"></script>
</head>
<body>
<div class="miniheader">
    <div class="miniheaderLeft"><a href="/"><img src="{{asset('/HomeCss/picture/miniheaderlogo.png')}}" alt='okbuy'></a></div>
    <div class="miniheaderMiddle" style="width:250px;float:left;margin:10px 0px 0px 300px;color:red;">
        @if (count($errors) > 0)
            <div>
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                    
                </ul>
            </div>
        @endif
        @if(session('error'))
            <span>{{session('error')}}</span>
        @endif
    </div>
    <div class="miniheaderRight">
        <cite id="top_nologin" style="display: inline-block;">
    	<a href="/home/login/login" title="">登录</a><span>|</span>
		<a href="/home/login/regist" title="">注册</a>
        </cite>
    	
    	
    </div>
</div>
    <div class="loginwarpper">
    
    <div class="login">
     <!-- style="background: url(http://i.okaybuy.cn/images/multipic/new/201602/77/7720d91bdfa055cb19d65d26272c8eb4.jpg) no-repeat;" -->
    <div class="relink">
    <a target="_blank" href="">
	<img border="0" width="487" height="587" src="{{asset('/HomeCss/picture/cadb8ced92624aa3aa2b3c5b048716f4.jpg')}}">
    </a>
    </div>
                
        <form class="loginRight registerRight" name="registerForm" id="registerForm" action="{{asset('/home/login/doregist')}}" method="post" autocomplete="off">
           
            <font color='red'></font> 
             <div id="mobileoremail">
                <div >
                    <div class="registertit">用户名：</div>
                    <div class="login_txt register_txt un">
                        <input type="text" id="uname" name="uname"  placeholder="请输入6-18位 字母数字下划线组合" autocomplete="off">
                        <span class="" style="display:none;"></span>
                    </div>
                    
                    <div class="true" id="true1"><img src="{{asset('/HomeCss/picture/vcodeicon.png')}}"></div>
                </div>
             
            </div>
            <div class="OB_clearB"></div>
            <div class="registererror" id="un"></div>
            <div class="OB_clearB"></div>
          <!--   <div id="mobileoremail">
                <div >
                    <div class="registertit">邮&ensp;&ensp;箱：</div>
                    <div class="login_txt register_txt">
                        <input type="text" name="email"  placeholder="请输入邮箱账号" autocomplete="off">
						<span class="" style="display:none;"></span>
                    </div>
                    
                    <div class="true" id="true1"><img src="{{asset('/HomeCss/picture/vcodeicon.png')}}"></div>
                </div>
             
            </div> -->
            <div>
                    <div class="registertit">手机号：</div>
                    <div class="login_txt register_txt">
                        <input type="text" name="tel"  placeholder="请输入正确的11位手机号" autocomplete="off">
                        <span class="" style="display:none;"></span>
                    </div>
                    
                    <div class="true" id="true2"><img src="{{asset('/HomeCss/picture/vcodeicon.png')}}"></div>
            </div>
            <div class="OB_clearB"></div>
            <div class="registererror" id="up"></div>
            <div class="OB_clearB"></div>

            <div class="registertit">密&ensp;&ensp;码：</div>
            <div class="login_txt register_txt">
                <input type="password" name="upwd"  value="" placeholder="请输入密码6-22位密码" autocomplete="off">
                <span id="togglePassword" class="show"></span>
            </div>
            <div class="true" id="true3"><img src="{{asset('/HomeCss/picture/vcodeicon.png')}}"></div>
            <div class="OB_clearB"></div>
            <div class="registererror" id="uw"></div>
            <div class="OB_clearB"></div>
            
             <div class="registercode">
            <div class="validateCodeDiv" id="validateCodeDiv_1">
                <div class="register_txt_validatcode"><pre>验证码：</pre></div>
                <div class="mobilecheck_3">
                    <div class="mcback validatecodeout">
                        <input type="text" id="" data-flag="0" name="vcode" maxlength="5" autocomplete="off"  placeholder="请输入验证码">
                        <img src="{{asset('/HomeCss/picture/vcodeicon.png')}}" class="icon1">
                        <!--<img src="picture/vcodeicon2.png" class="icon2">-->
                    </div>
                    <img src="/home/login/vcode" onclick="this.src=this.src+'?a=1'">
                    
                </div>
                <div class="true" id="true5"><img src="{{asset('/HomeCss/picture/vcodeicon.png')}}"></div>
            </div>
            </div>
            <div class="OB_clearB"></div>
            <span id="validatemsg" class="registererror"></span>
            <div class="OB_clearB"></div>

            <div class="registercode">
            <div class="validateCodeDiv" id="validateCodeDiv_1">
                <div class="register_txt_validatcode"><pre>手机验证码：</pre></div>
                <div class="mobilecheck_3">
                    <div class="mcback validatecodeout pc">
                        <input type="text" id="pcode" data-flag="0" name="pcode"  autocomplete="off"  placeholder="请输入验证码">
                        
                        <!--<img src="picture/vcodeicon2.png" class="icon2">-->
                    </div>
                    <button type="button" class="SendCode" style="height:40px;width:110px">获取验证码</button>
                    
                </div>
                <div class="true" id="true4"><img src="{{asset('/HomeCss/picture/vcodeicon.png')}}"></div>
            </div>
            </div>
            <div class="OB_clearB"></div>
            <div class="registererror" id="checkcode"></div>
            <div class="OB_clearB"></div>
            
           
            <p class="school_check_P">
                注册即视为同意<a href="" target="_blank">《好乐买隐私协议》</a>
            </p>
            <p class="btnP"><button class="register_btn" id="register_btn">注册</button></p>
            <p class="registericon">
                <!-- <img src="picture/icon.png" alt=""> -->
            </p>
            {{ csrf_field() }}
        </form>
    </div>
</div>
<!-- 百度回头客-到访定向 -->
<noscript>
<div style="display:none;">
    <img height="0" width="0" style="border-style:none;" src="{{asset('/HomeCss/picture/rt.jpg')}}" />
</div>
</noscript><div class="OB_clearB"></div>
<div class="minifooter">Copyright © 2007-2017 OkBuy.com All Rights Reserved&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;天津好乐买信息技术有限公司&nbsp;&nbsp;津B2-20140020&nbsp;&nbsp;京公网安备&nbsp;110105006859</div>
<!-- 绑定获取手机验证码事件 -->
<script type="text/javascript">
    //声明全局变量
    var CUSER = false;
    var CPASS = false;
    var CCODE = false;
    var CPCODE = false;
    var CTAL = false;
    
    //绑定表单事件
    $('form').submit(function(){
        //触发所有的丧失焦点事件
        $('input').trigger('blur');
        //判断是否全部成功
        if(CUSER && CPASS && CCODE && CPCODE && CTAL){
            return true;
        }

        return false;
    })

    //用户名丧失焦点事件
    $('input[name=uname]').blur(function(){
        // 获取输入的值
        var uname = $(this).val();
        //清空样式
        $('#true1').css('display','none');
        $('#un').html('');
        //检测用户名是否合法
        var reg = /^[a-zA-Z][a-zA-Z0-9_]{5,17}$/;
        if(!reg.test(uname)){
            $('#un').html('用户名格式不正确');
            CUSER = false;
            return false;
        }
            
        //发送ajax
        $.get('/home/login/isuser',{uname:uname},function(data){
            if(data ==1){
                $('#un').html('用户名已存在');
                 CUSER = false;
                return false;
            }else{
                $('#true1').css('display','block');
                CUSER = true;
            }
        })
       
    })

    //手机丧失焦点事件
    $('input[name=tel]').blur(function(){
        // 获取输入的值
        var tel = $(this).val();
        //清空样式
        $('#true2').css('display','none');
        $('#up').html('');
        //检测用户名是否合法
        var reg = /^[1][358][0-9]{9}$/;
        if(!reg.test(tel)){
            $('#up').html('手机号格式不正确');
            CTAL = false;
            return false;
        }

        //发送ajax
        $.get('/home/login/isphone',{tel:tel},function(data){
            if(data ==1){
                $('#up').html('手机号已存在');
                CTAL =  false;
            }else{
                $('#true2').css('display','block');
                CTAL = true;
            }
        })
    })

    //密码丧失焦点事件
    $('input[name=upwd]').blur(function(){
        // 获取输入的值
        var upwd = $(this).val();
        //清空样式
        $('#true3').css('display','none');
        $('#uw').html('');
        //检测用户名是否合法
        var reg = /^[\@A-Za-z0-9\!\#\$\%\^\&\*\.\~]{6,22}$/;
        if(!reg.test(upwd)){
            $('#uw').html('密码格式不正确');
            return false;
        }else{
            $('#true3').css('display','block');
            CPASS = true;
        }
    })

    //验证码丧失焦点验证
    $('input[name=vcode]').blur(function(){
        //获取输入的值
        var vcode = $(this).val();
        $('#true5').css('display','none');
        $('#validatemsg').html('');
        //发送ajax
        $.get('/home/login/code',{vcode:vcode},function(data){
            if(data == 1){
                $('#true5').css('display','block');
                CCODE = true;
            }else{
                $('#validatemsg').html('验证码不正确');
                CCODE = false;
                return false;
            }
        })

    })
    
   
    //发送手机验证码
    $('.SendCode').click(function(){
        //获取手机号
        var tel = $('input[name=tel]').val();
        $('#validatemsg').html('');
        if(CCODE){
            if(CTAL){
                //发送ajax 请求验证码
                $.get('/home/login/sendcode',{tel:tel},function(data){
                })
                //定时按钮
                var count = 9;
                var countdown = setInterval(CountDown, 1000);
                function CountDown(){
                $(".SendCode").attr("disabled", true);
                $(".SendCode").html("请"+count+"秒后重试");
                if (count == 0) {
                $(".SendCode").html("获取验证码").removeAttr("disabled");
                clearInterval(countdown);
                }
                count--;
                }
            }
                
           
        }else{
            $('#validatemsg').html('请先输入验证码');
        }
        
    })

    //手机验证码验证
    $('#pcode').blur(function(){
        //获取验证码
        var pcode = $('input[name=pcode]').val();
        $('#true4').css('display','none');
         $('#checkcode').html('');
        //当输入域丧失焦点时 发送ajax
        $.get('/home/login/pcode',{pcode:pcode},function(data){
            if(data == 1){
                $('#true4').css('display','block');
                CPCODE = true;
            }else{
                $('#checkcode').html('验证码错误');
                CPCODE = false;
                return false;
            }
        })
    })

    //显示密码
    $('.show').click(function(){
        var init = $('input[name=upwd]').attr('type');
        if(init == 'password'){
            $('input[name=upwd]').attr('type','text');
            
        }else{
            $('input[name=upwd]').attr('type','password');
            
        }
     
    })

</script>
</body>

</html> 
